import {
	defineConfig
} from 'vite';
import uni from '@dcloudio/vite-plugin-uni';
import AutoImport from 'unplugin-auto-import/vite'
import path from 'path';
import UnoCSS from 'unocss/vite'

export default defineConfig(() => {
	return {
		plugins: [
			UnoCSS(),
			uni(),
			AutoImport({
				include: [
					/\.[tj]sx?$/, // .ts, .tsx, .js, .jsx
					/\.vue$/,
					/\.vue\?vue/ // .vue
				],
				imports: ['vue'],
				dts: './auto-imports.d.ts'
			}),
		],
		reslove: {
			"@": path.resolve(__dirname, '/'),
			extensions: ['.mjs', '.js', '.jsx', '.json', '.vue'] // 引用文件名,
		},
		server: {},
		build: {
			watch: {
				exclude: ['node_modules/**', "/__uno.css"]
			},
		},
	}
})
